<?php
// +----------------------------------------------------------------------
// | 文件: index.php
// +----------------------------------------------------------------------
// | 功能: 提供todo api接口
// +----------------------------------------------------------------------
// | 时间: 2021-11-15 16:20
// +----------------------------------------------------------------------
// | 作者: rangangwei<gangweiran@tencent.com>
// +----------------------------------------------------------------------

namespace app\controller;

use Error;
use Exception;
use app\model\Counters;
use think\response\Html;
use think\response\Json;
use think\facade\Log;

class Demo
{

    /**
     * 主页静态页面
     * @return Html
     */
    public function index(): Html
    {
        # html路径: ../view/index.html
       echo 'this is demo page';
    }


    /**
     * 获取todo list
     * @return Json
     */
    public function get_demo(): Json
    {

        $res=['flag'=>true,'msg'=>'自定义接口demo','code'=>0,'data'=>'goods'];
            Log::write('demo test: '.json_encode($res));
            return json($res);

    }


}
